package com.dongdongshop.service.impl;

import com.dongdongshop.domain.res.AdminRes;
import com.dongdongshop.mapper.AdminMapper;
import com.dongdongshop.model.Admin;
import com.dongdongshop.service.AdminService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;
    @Override
    public AdminRes getAdminUser(String username) {
        Admin admin= adminMapper.getAdminUser(username);
        if (admin==null){
            return new AdminRes();
        }
        AdminRes adminRes=new AdminRes();
        BeanUtils.copyProperties(admin,adminRes);
        return adminRes;
    }
}
